//
//  LPSetColorShawod.m
//  ShangHaiHuDongApp
//
//  Created by 刘应平 on 2017/6/26.
//  Copyright © 2017年 刘应平. All rights reserved.
//

#import "LPSetColorShawod.h"

@implementation LPSetColorShawod
+ (CAGradientLayer *)setColorShwdodframe:(CGRect)frame{
    CAGradientLayer *newShadow = [[CAGradientLayer alloc] init];
    newShadow.frame = frame;
    //添加渐变的颜色组合（颜色透明度的改变）
    newShadow.colors = [NSArray arrayWithObjects:
                        (id)[[[UIColor themeColor] colorWithAlphaComponent:1] CGColor] ,
                        (id)[[[UIColor zj_colorWithHexString:@"1594d1"] colorWithAlphaComponent:1] CGColor],
                        (id)[[[UIColor zj_colorWithHexString:@"0fabdb"] colorWithAlphaComponent:1] CGColor],
                        (id)[[[UIColor zj_colorWithHexString:@"08cbe7"] colorWithAlphaComponent:1] CGColor],
                        (id)[[[UIColor zj_colorWithHexString:@"07d0e9"] colorWithAlphaComponent:1] CGColor],
                        nil];
    
    newShadow.locations = [NSArray arrayWithObjects:[NSNumber numberWithFloat:0.1],
                           [NSNumber numberWithFloat:0.3],
                           [NSNumber numberWithFloat:0.5],
                           [NSNumber numberWithFloat:0.7],
                           [NSNumber numberWithFloat:0.9],
                           nil];
    
    newShadow.startPoint = CGPointMake(0,1);
    newShadow.endPoint = CGPointMake(1,1);
    return newShadow;

}
@end
